package com.css.fxfzaqbz.util;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CodeUtil {

    private final static String FORMAT_CODE = "000";
    public static String getCode(){


        int count = 1; // 流水号
        DecimalFormat dft = new DecimalFormat(FORMAT_CODE);
        String code = dft.format(count); // 格式化为四位流水号 code: 001
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        String date = sdf.format(new Date()); // 格式化日期 date: 20210114
        String codeEnd =  date + code;
        System.out.println(codeEnd);
        return codeEnd;

    }
}
